use strict;
use warnings;

use Me2day;
use XML::Simple;
use Mac::Growl;
use Data::Dumper;
use Encode;

my $me2day = Me2day->new( username => "blahblah", user_key => "blahblah", app_key => "74589a73e765e8a2df0fa030c38c28ad" );

#my $res = $me2day->create_comment( post_id => "pge4p", body => "Me2Day Perl API TEST");

#print $res->as_string;

#my $res = $me2day->create_post( body => "유저에 대한 링크도 테스트 /pung96/" );

#print $res->as_string;
my $ress = $me2day->get_latests;
my $feed = XMLin($ress->content);
print Dumper $feed;
foreach my $post (@{$feed->{post}}) {
    Mac::Growl::PostNotification(
	'growlalert', 'alert',
	"TODO",
	Encode::encode("utf8", $post->{body}),
	);
}


